<template>
  <div class="account">
    <el-container>
      <el-header>
        <el-breadcrumb>
          <el-breadcrumb-item>基础信息维护</el-breadcrumb-item>
          <el-breadcrumb-item>商品分类维护</el-breadcrumb-item>
          <el-breadcrumb-item>添加子分类</el-breadcrumb-item>
        </el-breadcrumb>
      </el-header>
      <el-main>
        <div class="main-header">
          <el-button size="small" type="primary" @click="addTypeBtnClick">+ 新增子分类</el-button>
        </div>
        <div class="main-content">
          <div class="table-data">
            <el-table :data="tableData" border style="width: 100%">
              <el-table-column prop="order" label="编号" width="80" align="center"></el-table-column>
              <el-table-column prop="prdtClassify" label="商品子分类" align="center"></el-table-column>
              <el-table-column align="center">
                <template slot-scope="scope">
                  <el-button type="text" size="small" @click="resetResource(scope.row)">编辑</el-button>
                  <el-button type="text" size="small" @click="deleteBtnClick(scope.row)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </el-main>
      <el-footer>
        <div class="footer">
          <el-button type="primary">返回商品分类维护</el-button>
        </div>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 顶部搜索框
      input: "",
      // 回显数据
      tableData: [
        {
          order: 1,
          prdtClassify: "星级酒店"
        },
        {
          order: 2,
          prdtClassify: "度假酒店"
        },
        {
          order: 3,
          prdtClassify: "经济酒店"
        }
      ]
    };
  },
  methods: {
    // 新增
    addTypeBtnClick() {
      console.log("新增分类");
    },
    // 行内按钮
    addChildBtnClick(row) {
      console.log(row, "添加子分类");
    },
    resetResource(row) {
      console.log(row, "编辑");
    },
    setBtnClick(row) {
      console.log(row, "编辑");
    },
    deleteBtnClick(row) {
      console.log(row, "删除");
    }
  }
};
</script>

<style scoped>
.account .el-header {
  height: 60px;
  border-bottom: 1px solid #f3f3f3;
}
.el-breadcrumb {
  height: 60px;
  line-height: 60px;
}
.main-header {
  text-align: center;
  align-items: center;
  display: flex;
}
.main-header >>> .el-input {
  width: 200px;
  margin-right: 20px;
}
.main-content {
  margin: 40px;
}
.el-footer {
  margin: 0 auto;
}
</style>